export default defineNuxtPlugin((nuxtApp) => {
  // 只在客户端执行
  if (import.meta.client) {

    console.log('core plugin mounted')

    const loadCoreScript = async () => {
      try {
        // 只保留核心依赖的加载
        await loadScript('/html/assets/js/jquery-3.3.1.min.js')
        await loadScript('/html/assets/js/bootstrap.min.js')
      } catch (error) {
        console.error('加载核心脚本失败:', error)
      }
      // const scripts = [
      //   '/html/assets/js/jquery-3.3.1.min.js',
      //   '/html/assets/js/jquery-2.1.4.min.js',
      //   '/html/assets/js/theme-change.js',
      //   '/html/assets/js/jquery.chocolat.js',
      //   '/html/assets/js/jquery.waypoints.min.js',
      //   '/html/assets/js/jquery.countup.js',
      //   '/html/assets/js/owl.carousel.js',
      //   '/html/assets/js/jquery.magnific-popup.min.js',
      //   '/html/assets/js/modernizr.custom.js',
      //   '/html/assets/js/classie.js',
      //   '/html/assets/js/demo1.js',
      //   '/html/assets/js/bootstrap.min.js',
      // ]

    }

    nuxtApp.hook('app:mounted', () => {
      console.log('app mounted')
      loadCoreScript()
    })

  }
})
